package com.carwler.demo;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

import com.carwler.demo.repository.CarBrandRepository;
import com.carwler.demo.repository.CarSeriousRepository;
import com.carwler.demo.repository.CarTypeRepository;

@SpringBootApplication
public class Application  implements CommandLineRunner{

	public static void main(String[] args) throws Exception {
		SpringApplication.run(Application.class, args);
	}

	@Autowired
	private CarBrandRepository brandRepository;
	@Autowired
	private CarSeriousRepository seriousRepository;
	@Autowired
	private CarTypeRepository typeRepository;
	
	
	@Override
	public void run( String... arg0 ) throws Exception{
		 ThreadPool.addThreadToQueue( new QczjCrawler( brandRepository, seriousRepository, typeRepository ) );
	}

}
